<?xml version="1.0" encoding="ascii"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
          "DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
  <title>yadis.test.test_xri</title>
  <link rel="stylesheet" href="epydoc.css" type="text/css" />
  <script type="text/javascript" src="epydoc.js"></script>
</head>

<body bgcolor="white" text="black" link="blue" vlink="#204080"
      alink="#204080">
<!-- ==================== NAVIGATION BAR ==================== -->
<table class="navbar" border="0" width="100%" cellpadding="0"
       bgcolor="#a0c0ff" cellspacing="0">
  <tr valign="middle">
  <!-- Home link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="yadis-module.html">Home</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Tree link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="module-tree.html">Trees</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Index link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="identifier-index.html">Indices</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Help link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="help.html">Help</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Project homepage -->
      <th class="navbar" align="right" width="100%">
        <table border="0" cellpadding="0" cellspacing="0">
          <tr><th class="navbar" align="center"
            ><a class="navbar" target="_top" href="http://www.openidenabled.com/yadis/">Python-Yadis</a></th>
          </tr></table></th>
  </tr>
</table>
<table width="100%" cellpadding="0" cellspacing="0">
  <tr valign="top">
    <td width="100%">
      <span class="breadcrumbs">
        <a href="yadis-module.html">Package&nbsp;yadis</a> ::
        <a href="yadis.test-module.html">Package&nbsp;test</a> ::
        Module&nbsp;test_xri
      </span>
    </td>
    <td>
      <table cellpadding="0" cellspacing="0">
        <!-- hide/show private -->
        <tr><td align="right"><span class="options">[<a href="javascript:void(0);" class="privatelink"
    onclick="toggle_private();">hide private</a>]</span></td></tr>
        <tr><td align="right"><span class="options"
            >[<a href="frames.html" target="_top">frames</a
            >]&nbsp;|&nbsp;<a href="yadis.test.test_xri-pysrc.html"
            target="_top">no&nbsp;frames</a>]</span></td></tr>
      </table>
    </td>
  </tr>
</table>
<h1 class="epydoc">Source Code for <a href="yadis.test.test_xri-module.html">Module yadis.test.test_xri</a></h1>
<pre class="py-src">
<tt class="py-lineno">  1</tt>  <tt class="py-line"> </tt>
<tt class="py-lineno">  2</tt>  <tt class="py-line"><tt class="py-keyword">from</tt> <tt class="py-name">unittest</tt> <tt class="py-keyword">import</tt> <tt class="py-name">TestCase</tt> </tt>
<tt class="py-lineno">  3</tt>  <tt class="py-line"><tt class="py-keyword">from</tt> <tt id="link-0" class="py-name" targets="Package yadis=yadis-module.html"><a title="yadis" class="py-name" href="#" onclick="return doclink('link-0', 'yadis', 'link-0');">yadis</a></tt></tt> <tt class="py-keyword">import</tt> <tt id="link-1" class="py-name" targets="Module yadis.xri=yadis.xri-module.html"><a title="yadis.xri" class="py-name" href="#" onclick="return doclink('link-1', 'xri', 'link-1');">xri</a></tt></tt> </tt>
<tt class="py-lineno">  4</tt>  <tt class="py-line"> </tt>
<a name="XriDiscoveryTestCase"></a><div id="XriDiscoveryTestCase-def"><tt class="py-lineno">  5</tt> <a class="py-toggle" href="#" id="XriDiscoveryTestCase-toggle" onclick="return toggle('XriDiscoveryTestCase');">-</a><tt class="py-line"><tt class="py-keyword">class</tt> <a class="py-def-name" href="yadis.test.test_xri.XriDiscoveryTestCase-class.html">XriDiscoveryTestCase</a><tt class="py-op">(</tt><tt class="py-base-class">TestCase</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="XriDiscoveryTestCase-collapsed" style="display:none;" pad="+++" indent="++++"></div><div id="XriDiscoveryTestCase-expanded"><a name="XriDiscoveryTestCase.test_isXRI"></a><div id="XriDiscoveryTestCase.test_isXRI-def"><tt class="py-lineno">  6</tt> <a class="py-toggle" href="#" id="XriDiscoveryTestCase.test_isXRI-toggle" onclick="return toggle('XriDiscoveryTestCase.test_isXRI');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="yadis.test.test_xri.XriDiscoveryTestCase-class.html#test_isXRI">test_isXRI</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="XriDiscoveryTestCase.test_isXRI-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="XriDiscoveryTestCase.test_isXRI-expanded"><tt class="py-lineno">  7</tt>  <tt class="py-line">        <tt class="py-name">i</tt> <tt class="py-op">=</tt> <tt id="link-2" class="py-name"><a title="yadis.xri" class="py-name" href="#" onclick="return doclink('link-2', 'xri', 'link-1');">xri</a></tt></tt><tt class="py-op">.</tt><tt id="link-3" class="py-name" targets="Function yadis.xri.identifierScheme()=yadis.xri-module.html#identifierScheme"><a title="yadis.xri.identifierScheme" class="py-name" href="#" onclick="return doclink('link-3', 'identifierScheme', 'link-3');">identifierScheme</a></tt></tt> </tt>
<tt class="py-lineno">  8</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">failUnlessEqual</tt><tt class="py-op">(</tt><tt class="py-name">i</tt><tt class="py-op">(</tt><tt class="py-string">'=john.smith'</tt><tt class="py-op">)</tt><tt class="py-op">,</tt> <tt class="py-string">'XRI'</tt><tt class="py-op">)</tt> </tt>
<tt class="py-lineno">  9</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">failUnlessEqual</tt><tt class="py-op">(</tt><tt class="py-name">i</tt><tt class="py-op">(</tt><tt class="py-string">'@smiths/john'</tt><tt class="py-op">)</tt><tt class="py-op">,</tt> <tt class="py-string">'XRI'</tt><tt class="py-op">)</tt> </tt>
<tt class="py-lineno"> 10</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">failUnlessEqual</tt><tt class="py-op">(</tt><tt class="py-name">i</tt><tt class="py-op">(</tt><tt class="py-string">'smoker.myopenid.com'</tt><tt class="py-op">)</tt><tt class="py-op">,</tt> <tt class="py-string">'URI'</tt><tt class="py-op">)</tt> </tt>
<tt class="py-lineno"> 11</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">failUnlessEqual</tt><tt class="py-op">(</tt><tt class="py-name">i</tt><tt class="py-op">(</tt><tt class="py-string">'xri://=john'</tt><tt class="py-op">)</tt><tt class="py-op">,</tt> <tt class="py-string">'XRI'</tt><tt class="py-op">)</tt> </tt>
</div></div><tt class="py-lineno"> 12</tt>  <tt class="py-line"> </tt>
<tt class="py-lineno"> 13</tt>  <tt class="py-line"> </tt>
<a name="XriEscapingTestCase"></a><div id="XriEscapingTestCase-def"><tt class="py-lineno"> 14</tt> <a class="py-toggle" href="#" id="XriEscapingTestCase-toggle" onclick="return toggle('XriEscapingTestCase');">-</a><tt class="py-line"><tt class="py-keyword">class</tt> <a class="py-def-name" href="yadis.test.test_xri.XriEscapingTestCase-class.html">XriEscapingTestCase</a><tt class="py-op">(</tt><tt class="py-base-class">TestCase</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="XriEscapingTestCase-collapsed" style="display:none;" pad="+++" indent="++++"></div><div id="XriEscapingTestCase-expanded"><a name="XriEscapingTestCase.test_escaping_percents"></a><div id="XriEscapingTestCase.test_escaping_percents-def"><tt class="py-lineno"> 15</tt> <a class="py-toggle" href="#" id="XriEscapingTestCase.test_escaping_percents-toggle" onclick="return toggle('XriEscapingTestCase.test_escaping_percents');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="yadis.test.test_xri.XriEscapingTestCase-class.html#test_escaping_percents">test_escaping_percents</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="XriEscapingTestCase.test_escaping_percents-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="XriEscapingTestCase.test_escaping_percents-expanded"><tt class="py-lineno"> 16</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">failUnlessEqual</tt><tt class="py-op">(</tt><tt id="link-4" class="py-name"><a title="yadis.xri" class="py-name" href="#" onclick="return doclink('link-4', 'xri', 'link-1');">xri</a></tt></tt><tt class="py-op">.</tt><tt id="link-5" class="py-name" targets="Function yadis.xri.escapeForIRI()=yadis.xri-module.html#escapeForIRI"><a title="yadis.xri.escapeForIRI" class="py-name" href="#" onclick="return doclink('link-5', 'escapeForIRI', 'link-5');">escapeForIRI</a></tt></tt><tt class="py-op">(</tt><tt class="py-string">'@example/abc%2Fd/ef'</tt><tt class="py-op">)</tt><tt class="py-op">,</tt> </tt>
<tt class="py-lineno"> 17</tt>  <tt class="py-line">                             <tt class="py-string">'@example/abc%252Fd/ef'</tt><tt class="py-op">)</tt> </tt>
</div><tt class="py-lineno"> 18</tt>  <tt class="py-line"> </tt>
<tt class="py-lineno"> 19</tt>  <tt class="py-line"> </tt>
<a name="XriEscapingTestCase.test_escaping_xref"></a><div id="XriEscapingTestCase.test_escaping_xref-def"><tt class="py-lineno"> 20</tt> <a class="py-toggle" href="#" id="XriEscapingTestCase.test_escaping_xref-toggle" onclick="return toggle('XriEscapingTestCase.test_escaping_xref');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="yadis.test.test_xri.XriEscapingTestCase-class.html#test_escaping_xref">test_escaping_xref</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="XriEscapingTestCase.test_escaping_xref-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="XriEscapingTestCase.test_escaping_xref-expanded"><tt class="py-lineno"> 21</tt>  <tt class="py-line">        <tt class="py-comment"># no escapes</tt> </tt>
<tt class="py-lineno"> 22</tt>  <tt class="py-line"><tt class="py-comment"></tt>        <tt class="py-name">esc</tt> <tt class="py-op">=</tt> <tt id="link-6" class="py-name"><a title="yadis.xri" class="py-name" href="#" onclick="return doclink('link-6', 'xri', 'link-1');">xri</a></tt></tt><tt class="py-op">.</tt><tt id="link-7" class="py-name"><a title="yadis.xri.escapeForIRI" class="py-name" href="#" onclick="return doclink('link-7', 'escapeForIRI', 'link-5');">escapeForIRI</a></tt></tt> </tt>
<tt class="py-lineno"> 23</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">failUnlessEqual</tt><tt class="py-op">(</tt><tt class="py-string">'@example/foo/(@bar)'</tt><tt class="py-op">,</tt> <tt class="py-name">esc</tt><tt class="py-op">(</tt><tt class="py-string">'@example/foo/(@bar)'</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
<tt class="py-lineno"> 24</tt>  <tt class="py-line">        <tt class="py-comment"># escape slashes</tt> </tt>
<tt class="py-lineno"> 25</tt>  <tt class="py-line"><tt class="py-comment"></tt>        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">failUnlessEqual</tt><tt class="py-op">(</tt><tt class="py-string">'@example/foo/(@bar%2Fbaz)'</tt><tt class="py-op">,</tt> </tt>
<tt class="py-lineno"> 26</tt>  <tt class="py-line">                             <tt class="py-name">esc</tt><tt class="py-op">(</tt><tt class="py-string">'@example/foo/(@bar/baz)'</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
<tt class="py-lineno"> 27</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">failUnlessEqual</tt><tt class="py-op">(</tt><tt class="py-string">'@example/foo/(@bar%2Fbaz)/(+a%2Fb)'</tt><tt class="py-op">,</tt> </tt>
<tt class="py-lineno"> 28</tt>  <tt class="py-line">                             <tt class="py-name">esc</tt><tt class="py-op">(</tt><tt class="py-string">'@example/foo/(@bar/baz)/(+a/b)'</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
<tt class="py-lineno"> 29</tt>  <tt class="py-line">        <tt class="py-comment"># escape query ? and fragment #</tt> </tt>
<tt class="py-lineno"> 30</tt>  <tt class="py-line"><tt class="py-comment"></tt>        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">failUnlessEqual</tt><tt class="py-op">(</tt><tt class="py-string">'@example/foo/(@baz%3Fp=q%23r)?i=j#k'</tt><tt class="py-op">,</tt> </tt>
<tt class="py-lineno"> 31</tt>  <tt class="py-line">                             <tt class="py-name">esc</tt><tt class="py-op">(</tt><tt class="py-string">'@example/foo/(@baz?p=q#r)?i=j#k'</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
</div></div><tt class="py-lineno"> 32</tt>  <tt class="py-line"> </tt>
<tt class="py-lineno"> 33</tt>  <tt class="py-line"> </tt>
<tt class="py-lineno"> 34</tt>  <tt class="py-line"> </tt>
<a name="XriTransformationTestCase"></a><div id="XriTransformationTestCase-def"><tt class="py-lineno"> 35</tt> <a class="py-toggle" href="#" id="XriTransformationTestCase-toggle" onclick="return toggle('XriTransformationTestCase');">-</a><tt class="py-line"><tt class="py-keyword">class</tt> <a class="py-def-name" href="yadis.test.test_xri.XriTransformationTestCase-class.html">XriTransformationTestCase</a><tt class="py-op">(</tt><tt class="py-base-class">TestCase</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="XriTransformationTestCase-collapsed" style="display:none;" pad="+++" indent="++++"></div><div id="XriTransformationTestCase-expanded"><a name="XriTransformationTestCase.test_to_iri_normal"></a><div id="XriTransformationTestCase.test_to_iri_normal-def"><tt class="py-lineno"> 36</tt> <a class="py-toggle" href="#" id="XriTransformationTestCase.test_to_iri_normal-toggle" onclick="return toggle('XriTransformationTestCase.test_to_iri_normal');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="yadis.test.test_xri.XriTransformationTestCase-class.html#test_to_iri_normal">test_to_iri_normal</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="XriTransformationTestCase.test_to_iri_normal-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="XriTransformationTestCase.test_to_iri_normal-expanded"><tt class="py-lineno"> 37</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">failUnlessEqual</tt><tt class="py-op">(</tt><tt id="link-8" class="py-name"><a title="yadis.xri" class="py-name" href="#" onclick="return doclink('link-8', 'xri', 'link-1');">xri</a></tt></tt><tt class="py-op">.</tt><tt id="link-9" class="py-name" targets="Function yadis.xri.toIRINormal()=yadis.xri-module.html#toIRINormal"><a title="yadis.xri.toIRINormal" class="py-name" href="#" onclick="return doclink('link-9', 'toIRINormal', 'link-9');">toIRINormal</a></tt></tt><tt class="py-op">(</tt><tt class="py-string">'@example'</tt><tt class="py-op">)</tt><tt class="py-op">,</tt> <tt class="py-string">'xri://@example'</tt><tt class="py-op">)</tt> </tt>
</div><tt class="py-lineno"> 38</tt>  <tt class="py-line"> </tt>
<tt class="py-lineno"> 39</tt>  <tt class="py-line">    <tt class="py-keyword">try</tt><tt class="py-op">:</tt> </tt>
<tt class="py-lineno"> 40</tt>  <tt class="py-line">        <tt class="py-name">unichr</tt><tt class="py-op">(</tt><tt class="py-number">0x10000</tt><tt class="py-op">)</tt> </tt>
<tt class="py-lineno"> 41</tt>  <tt class="py-line">    <tt class="py-keyword">except</tt> <tt class="py-name">ValueError</tt><tt class="py-op">:</tt> </tt>
<tt class="py-lineno"> 42</tt>  <tt class="py-line">        <tt class="py-comment"># bleh narrow python build</tt> </tt>
<a name="XriTransformationTestCase.test_iri_to_url"></a><div id="XriTransformationTestCase.test_iri_to_url-def"><tt class="py-lineno"> 43</tt> <a class="py-toggle" href="#" id="XriTransformationTestCase.test_iri_to_url-toggle" onclick="return toggle('XriTransformationTestCase.test_iri_to_url');">-</a><tt class="py-line"><tt class="py-comment"></tt>        <tt class="py-keyword">def</tt> <a class="py-def-name" href="yadis.test.test_xri.XriTransformationTestCase-class.html#test_iri_to_url">test_iri_to_url</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="XriTransformationTestCase.test_iri_to_url-collapsed" style="display:none;" pad="+++" indent="++++++++++++++++"></div><div id="XriTransformationTestCase.test_iri_to_url-expanded"><tt class="py-lineno"> 44</tt>  <tt class="py-line">            <tt class="py-name">s</tt> <tt class="py-op">=</tt> <tt class="py-string">u'l\xa1m'</tt> </tt>
<tt class="py-lineno"> 45</tt>  <tt class="py-line">            <tt class="py-name">expected</tt> <tt class="py-op">=</tt> <tt class="py-string">'l%C2%A1m'</tt> </tt>
<tt class="py-lineno"> 46</tt>  <tt class="py-line">            <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">failUnlessEqual</tt><tt class="py-op">(</tt><tt id="link-10" class="py-name"><a title="yadis.xri" class="py-name" href="#" onclick="return doclink('link-10', 'xri', 'link-1');">xri</a></tt></tt><tt class="py-op">.</tt><tt id="link-11" class="py-name" targets="Function yadis.xri.iriToURI()=yadis.xri-module.html#iriToURI"><a title="yadis.xri.iriToURI" class="py-name" href="#" onclick="return doclink('link-11', 'iriToURI', 'link-11');">iriToURI</a></tt></tt><tt class="py-op">(</tt><tt class="py-name">s</tt><tt class="py-op">)</tt><tt class="py-op">,</tt> <tt class="py-name">expected</tt><tt class="py-op">)</tt> </tt>
</div><tt class="py-lineno"> 47</tt>  <tt class="py-line">    <tt class="py-keyword">else</tt><tt class="py-op">:</tt> </tt>
<a name="XriTransformationTestCase.test_iri_to_url"></a><div id="XriTransformationTestCase.test_iri_to_url-def"><tt class="py-lineno"> 48</tt> <a class="py-toggle" href="#" id="XriTransformationTestCase.test_iri_to_url-toggle" onclick="return toggle('XriTransformationTestCase.test_iri_to_url');">-</a><tt class="py-line">        <tt class="py-keyword">def</tt> <a class="py-def-name" href="yadis.test.test_xri.XriTransformationTestCase-class.html#test_iri_to_url">test_iri_to_url</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="XriTransformationTestCase.test_iri_to_url-collapsed" style="display:none;" pad="+++" indent="++++++++++++++++"></div><div id="XriTransformationTestCase.test_iri_to_url-expanded"><tt class="py-lineno"> 49</tt>  <tt class="py-line">            <tt class="py-name">s</tt> <tt class="py-op">=</tt> <tt class="py-string">u'l\xa1m\U00101010n'</tt> </tt>
<tt class="py-lineno"> 50</tt>  <tt class="py-line">            <tt class="py-name">expected</tt> <tt class="py-op">=</tt> <tt class="py-string">'l%C2%A1m%F4%81%80%90n'</tt> </tt>
<tt class="py-lineno"> 51</tt>  <tt class="py-line">            <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">failUnlessEqual</tt><tt class="py-op">(</tt><tt id="link-12" class="py-name"><a title="yadis.xri" class="py-name" href="#" onclick="return doclink('link-12', 'xri', 'link-1');">xri</a></tt></tt><tt class="py-op">.</tt><tt id="link-13" class="py-name"><a title="yadis.xri.iriToURI" class="py-name" href="#" onclick="return doclink('link-13', 'iriToURI', 'link-11');">iriToURI</a></tt></tt><tt class="py-op">(</tt><tt class="py-name">s</tt><tt class="py-op">)</tt><tt class="py-op">,</tt> <tt class="py-name">expected</tt><tt class="py-op">)</tt> </tt>
</div></div><tt class="py-lineno"> 52</tt>  <tt class="py-line"> </tt>
<tt class="py-lineno"> 53</tt>  <tt class="py-line"> </tt>
<tt class="py-lineno"> 54</tt>  <tt class="py-line"> </tt>
<a name="CanonicalIDTest"></a><div id="CanonicalIDTest-def"><tt class="py-lineno"> 55</tt> <a class="py-toggle" href="#" id="CanonicalIDTest-toggle" onclick="return toggle('CanonicalIDTest');">-</a><tt class="py-line"><tt class="py-keyword">class</tt> <a class="py-def-name" href="yadis.test.test_xri.CanonicalIDTest-class.html">CanonicalIDTest</a><tt class="py-op">(</tt><tt class="py-base-class">TestCase</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="CanonicalIDTest-collapsed" style="display:none;" pad="+++" indent="++++"></div><div id="CanonicalIDTest-expanded"><tt class="py-lineno"> 56</tt>  <tt class="py-line">    <tt id="link-14" class="py-name" targets="Variable yadis.test.test_xri.CanonicalIDTest.providerIsAuthoritativeCases=yadis.test.test_xri.CanonicalIDTest-class.html#providerIsAuthoritativeCases"><a title="yadis.test.test_xri.CanonicalIDTest.providerIsAuthoritativeCases" class="py-name" href="#" onclick="return doclink('link-14', 'providerIsAuthoritativeCases', 'link-14');">providerIsAuthoritativeCases</a></tt></tt> <tt class="py-op">=</tt> <tt class="py-op">[</tt> </tt>
<tt class="py-lineno"> 57</tt>  <tt class="py-line">        <tt class="py-comment"># provider, canonicalID, isAuthoritative</tt> </tt>
<tt class="py-lineno"> 58</tt>  <tt class="py-line">        <tt class="py-op">(</tt><tt class="py-string">'='</tt><tt class="py-op">,</tt> <tt class="py-string">'=!698.74D1.A1F2.86C7'</tt><tt class="py-op">,</tt> <tt class="py-name">True</tt><tt class="py-op">)</tt><tt class="py-op">,</tt> </tt>
<tt class="py-lineno"> 59</tt>  <tt class="py-line">        <tt class="py-op">(</tt><tt class="py-string">'@!1234'</tt><tt class="py-op">,</tt> <tt class="py-string">'@!1234!ABCD'</tt><tt class="py-op">,</tt> <tt class="py-name">True</tt><tt class="py-op">)</tt><tt class="py-op">,</tt> </tt>
<tt class="py-lineno"> 60</tt>  <tt class="py-line">        <tt class="py-op">(</tt><tt class="py-string">'@!1234!5678'</tt><tt class="py-op">,</tt> <tt class="py-string">'@!1234!5678!ABCD'</tt><tt class="py-op">,</tt> <tt class="py-name">True</tt><tt class="py-op">)</tt><tt class="py-op">,</tt> </tt>
<tt class="py-lineno"> 61</tt>  <tt class="py-line">        <tt class="py-op">(</tt><tt class="py-string">'@!1234'</tt><tt class="py-op">,</tt> <tt class="py-string">'=!1234!ABCD'</tt><tt class="py-op">,</tt> <tt class="py-name">False</tt><tt class="py-op">)</tt><tt class="py-op">,</tt> </tt>
<tt class="py-lineno"> 62</tt>  <tt class="py-line">        <tt class="py-op">(</tt><tt class="py-string">'@!1234'</tt><tt class="py-op">,</tt> <tt class="py-string">'@!1234!ABCD!9765'</tt><tt class="py-op">,</tt> <tt class="py-name">False</tt><tt class="py-op">)</tt><tt class="py-op">,</tt> </tt>
<tt class="py-lineno"> 63</tt>  <tt class="py-line">        <tt class="py-op">(</tt><tt class="py-string">'@!1234!ABCD'</tt><tt class="py-op">,</tt> <tt class="py-string">'=!1234'</tt><tt class="py-op">,</tt> <tt class="py-name">False</tt><tt class="py-op">)</tt><tt class="py-op">,</tt> </tt>
<tt class="py-lineno"> 64</tt>  <tt class="py-line">        <tt class="py-op">(</tt><tt class="py-string">'=!BABE'</tt><tt class="py-op">,</tt> <tt class="py-string">'=!D00D'</tt><tt class="py-op">,</tt> <tt class="py-name">False</tt><tt class="py-op">)</tt><tt class="py-op">,</tt> </tt>
<tt class="py-lineno"> 65</tt>  <tt class="py-line">        <tt class="py-op">]</tt> </tt>
<tt class="py-lineno"> 66</tt>  <tt class="py-line"> </tt>
<tt class="py-lineno"> 67</tt>  <tt class="py-line"> </tt>
<a name="CanonicalIDTest.test_providerIsAuthoritative"></a><div id="CanonicalIDTest.test_providerIsAuthoritative-def"><tt class="py-lineno"> 68</tt> <a class="py-toggle" href="#" id="CanonicalIDTest.test_providerIsAuthoritative-toggle" onclick="return toggle('CanonicalIDTest.test_providerIsAuthoritative');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="yadis.test.test_xri.CanonicalIDTest-class.html#test_providerIsAuthoritative">test_providerIsAuthoritative</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="CanonicalIDTest.test_providerIsAuthoritative-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="CanonicalIDTest.test_providerIsAuthoritative-expanded"><tt class="py-lineno"> 69</tt>  <tt class="py-line">        <tt class="py-docstring">"""Checking whether this provider is authoratitve for</tt> </tt>
<tt class="py-lineno"> 70</tt>  <tt class="py-line"><tt class="py-docstring">        the given XRI."""</tt> </tt>
<tt class="py-lineno"> 71</tt>  <tt class="py-line">        <tt class="py-comment"># XXX: Should perhaps be more like the other data-driven tests?</tt> </tt>
<tt class="py-lineno"> 72</tt>  <tt class="py-line"><tt class="py-comment"></tt>        <tt class="py-keyword">for</tt> <tt class="py-name">providerID</tt><tt class="py-op">,</tt> <tt class="py-name">canonicalID</tt><tt class="py-op">,</tt> <tt class="py-name">isAuthoritative</tt> <tt class="py-keyword">in</tt> \ </tt>
<tt class="py-lineno"> 73</tt>  <tt class="py-line">                <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-15" class="py-name"><a title="yadis.test.test_xri.CanonicalIDTest.providerIsAuthoritativeCases" class="py-name" href="#" onclick="return doclink('link-15', 'providerIsAuthoritativeCases', 'link-14');">providerIsAuthoritativeCases</a></tt></tt><tt class="py-op">:</tt> </tt>
<tt class="py-lineno"> 74</tt>  <tt class="py-line">            <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-16" class="py-name" targets="Method yadis.test.test_xri.CanonicalIDTest._providerIsAuthoritative()=yadis.test.test_xri.CanonicalIDTest-class.html#_providerIsAuthoritative"><a title="yadis.test.test_xri.CanonicalIDTest._providerIsAuthoritative" class="py-name" href="#" onclick="return doclink('link-16', '_providerIsAuthoritative', 'link-16');">_providerIsAuthoritative</a></tt></tt><tt class="py-op">(</tt><tt class="py-name">providerID</tt><tt class="py-op">,</tt> <tt class="py-name">canonicalID</tt><tt class="py-op">,</tt> </tt>
<tt class="py-lineno"> 75</tt>  <tt class="py-line">                                          <tt class="py-name">isAuthoritative</tt><tt class="py-op">)</tt> </tt>
</div><tt class="py-lineno"> 76</tt>  <tt class="py-line"> </tt>
<tt class="py-lineno"> 77</tt>  <tt class="py-line"> </tt>
<a name="CanonicalIDTest._providerIsAuthoritative"></a><div id="CanonicalIDTest._providerIsAuthoritative-def"><tt class="py-lineno"> 78</tt> <a class="py-toggle" href="#" id="CanonicalIDTest._providerIsAuthoritative-toggle" onclick="return toggle('CanonicalIDTest._providerIsAuthoritative');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="yadis.test.test_xri.CanonicalIDTest-class.html#_providerIsAuthoritative">_providerIsAuthoritative</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt> <tt class="py-param">providerID</tt><tt class="py-op">,</tt> <tt class="py-param">canonicalID</tt><tt class="py-op">,</tt> <tt class="py-param">expected</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="CanonicalIDTest._providerIsAuthoritative-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="CanonicalIDTest._providerIsAuthoritative-expanded"><tt class="py-lineno"> 79</tt>  <tt class="py-line">        <tt class="py-name">result</tt> <tt class="py-op">=</tt> <tt id="link-17" class="py-name"><a title="yadis.xri" class="py-name" href="#" onclick="return doclink('link-17', 'xri', 'link-1');">xri</a></tt></tt><tt class="py-op">.</tt><tt id="link-18" class="py-name" targets="Function yadis.xri.providerIsAuthoritative()=yadis.xri-module.html#providerIsAuthoritative"><a title="yadis.xri.providerIsAuthoritative" class="py-name" href="#" onclick="return doclink('link-18', 'providerIsAuthoritative', 'link-18');">providerIsAuthoritative</a></tt></tt><tt class="py-op">(</tt><tt class="py-name">providerID</tt><tt class="py-op">,</tt> <tt class="py-name">canonicalID</tt><tt class="py-op">)</tt> </tt>
<tt class="py-lineno"> 80</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">failUnlessEqual</tt><tt class="py-op">(</tt><tt class="py-name">expected</tt><tt class="py-op">,</tt> <tt class="py-name">result</tt><tt class="py-op">,</tt> </tt>
<tt class="py-lineno"> 81</tt>  <tt class="py-line">                             <tt class="py-string">"%s providing %s, expected %s"</tt> <tt class="py-op">%</tt> <tt class="py-op">(</tt><tt class="py-name">providerID</tt><tt class="py-op">,</tt> </tt>
<tt class="py-lineno"> 82</tt>  <tt class="py-line">                                                               <tt class="py-name">canonicalID</tt><tt class="py-op">,</tt> </tt>
<tt class="py-lineno"> 83</tt>  <tt class="py-line">                                                               <tt class="py-name">expected</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
</div></div><tt class="py-lineno"> 84</tt>  <tt class="py-line"> </tt>
<tt class="py-lineno"> 85</tt>  <tt class="py-line"> </tt>
<tt class="py-lineno"> 86</tt>  <tt class="py-line"> </tt>
<a name="TestGetRootAuthority"></a><div id="TestGetRootAuthority-def"><tt class="py-lineno"> 87</tt> <a class="py-toggle" href="#" id="TestGetRootAuthority-toggle" onclick="return toggle('TestGetRootAuthority');">-</a><tt class="py-line"><tt class="py-keyword">class</tt> <a class="py-def-name" href="yadis.test.test_xri.TestGetRootAuthority-class.html">TestGetRootAuthority</a><tt class="py-op">(</tt><tt class="py-base-class">TestCase</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="TestGetRootAuthority-collapsed" style="display:none;" pad="+++" indent="++++"></div><div id="TestGetRootAuthority-expanded"><tt class="py-lineno"> 88</tt>  <tt class="py-line">    <tt id="link-19" class="py-name" targets="Variable yadis.test.test_xri.TestGetRootAuthority.xris=yadis.test.test_xri.TestGetRootAuthority-class.html#xris"><a title="yadis.test.test_xri.TestGetRootAuthority.xris" class="py-name" href="#" onclick="return doclink('link-19', 'xris', 'link-19');">xris</a></tt></tt> <tt class="py-op">=</tt> <tt class="py-op">[</tt> </tt>
<tt class="py-lineno"> 89</tt>  <tt class="py-line">        <tt class="py-op">(</tt><tt class="py-string">"@foo"</tt><tt class="py-op">,</tt> <tt class="py-string">"@"</tt><tt class="py-op">)</tt><tt class="py-op">,</tt> </tt>
<tt class="py-lineno"> 90</tt>  <tt class="py-line">        <tt class="py-op">(</tt><tt class="py-string">"@foo*bar"</tt><tt class="py-op">,</tt> <tt class="py-string">"@"</tt><tt class="py-op">)</tt><tt class="py-op">,</tt> </tt>
<tt class="py-lineno"> 91</tt>  <tt class="py-line">        <tt class="py-op">(</tt><tt class="py-string">"@*foo*bar"</tt><tt class="py-op">,</tt> <tt class="py-string">"@"</tt><tt class="py-op">)</tt><tt class="py-op">,</tt> </tt>
<tt class="py-lineno"> 92</tt>  <tt class="py-line">        <tt class="py-op">(</tt><tt class="py-string">"@foo/bar"</tt><tt class="py-op">,</tt> <tt class="py-string">"@"</tt><tt class="py-op">)</tt><tt class="py-op">,</tt> </tt>
<tt class="py-lineno"> 93</tt>  <tt class="py-line">        <tt class="py-op">(</tt><tt class="py-string">"!!990!991"</tt><tt class="py-op">,</tt> <tt class="py-string">"!"</tt><tt class="py-op">)</tt><tt class="py-op">,</tt> </tt>
<tt class="py-lineno"> 94</tt>  <tt class="py-line">        <tt class="py-op">(</tt><tt class="py-string">"!1001!02"</tt><tt class="py-op">,</tt> <tt class="py-string">"!"</tt><tt class="py-op">)</tt><tt class="py-op">,</tt> </tt>
<tt class="py-lineno"> 95</tt>  <tt class="py-line">        <tt class="py-op">(</tt><tt class="py-string">"=foo*bar"</tt><tt class="py-op">,</tt> <tt class="py-string">"="</tt><tt class="py-op">)</tt><tt class="py-op">,</tt> </tt>
<tt class="py-lineno"> 96</tt>  <tt class="py-line">        <tt class="py-op">(</tt><tt class="py-string">"(example.com)/foo"</tt><tt class="py-op">,</tt> <tt class="py-string">"(example.com)"</tt><tt class="py-op">)</tt><tt class="py-op">,</tt> </tt>
<tt class="py-lineno"> 97</tt>  <tt class="py-line">        <tt class="py-op">(</tt><tt class="py-string">"(example.com)*bar/foo"</tt><tt class="py-op">,</tt> <tt class="py-string">"(example.com)"</tt><tt class="py-op">)</tt><tt class="py-op">,</tt> </tt>
<tt class="py-lineno"> 98</tt>  <tt class="py-line">        <tt class="py-op">(</tt><tt class="py-string">"baz.example.com/foo"</tt><tt class="py-op">,</tt> <tt class="py-string">"baz.example.com"</tt><tt class="py-op">)</tt><tt class="py-op">,</tt> </tt>
<tt class="py-lineno"> 99</tt>  <tt class="py-line">        <tt class="py-op">(</tt><tt class="py-string">"baz.example.com:8080/foo"</tt><tt class="py-op">,</tt> <tt class="py-string">"baz.example.com:8080"</tt><tt class="py-op">)</tt><tt class="py-op">,</tt> </tt>
<tt class="py-lineno">100</tt>  <tt class="py-line">        <tt class="py-comment"># Looking at the ABNF in XRI Syntax 2.0, I don't think you can</tt> </tt>
<tt class="py-lineno">101</tt>  <tt class="py-line">        <tt class="py-comment"># have example.com*bar.  You can do (example.com)*bar, but that</tt> </tt>
<tt class="py-lineno">102</tt>  <tt class="py-line">        <tt class="py-comment"># would mean something else.</tt> </tt>
<tt class="py-lineno">103</tt>  <tt class="py-line">        <tt class="py-comment">##("example.com*bar/(=baz)", "example.com*bar"),</tt> </tt>
<tt class="py-lineno">104</tt>  <tt class="py-line">        <tt class="py-comment">##("baz.example.com!01/foo", "baz.example.com!01"),</tt> </tt>
<tt class="py-lineno">105</tt>  <tt class="py-line">        <tt class="py-op">]</tt> </tt>
<tt class="py-lineno">106</tt>  <tt class="py-line"> </tt>
<tt class="py-lineno">107</tt>  <tt class="py-line"> </tt>
<a name="TestGetRootAuthority.test_getRootAuthority"></a><div id="TestGetRootAuthority.test_getRootAuthority-def"><tt class="py-lineno">108</tt> <a class="py-toggle" href="#" id="TestGetRootAuthority.test_getRootAuthority-toggle" onclick="return toggle('TestGetRootAuthority.test_getRootAuthority');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="yadis.test.test_xri.TestGetRootAuthority-class.html#test_getRootAuthority">test_getRootAuthority</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="TestGetRootAuthority.test_getRootAuthority-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="TestGetRootAuthority.test_getRootAuthority-expanded"><tt class="py-lineno">109</tt>  <tt class="py-line">        <tt class="py-keyword">for</tt> <tt class="py-name">thexri</tt><tt class="py-op">,</tt> <tt class="py-name">expected_root</tt> <tt class="py-keyword">in</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-20" class="py-name"><a title="yadis.test.test_xri.TestGetRootAuthority.xris" class="py-name" href="#" onclick="return doclink('link-20', 'xris', 'link-19');">xris</a></tt></tt><tt class="py-op">:</tt> </tt>
<tt class="py-lineno">110</tt>  <tt class="py-line">            <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">failUnlessEqual</tt><tt class="py-op">(</tt><tt id="link-21" class="py-name"><a title="yadis.xri" class="py-name" href="#" onclick="return doclink('link-21', 'xri', 'link-1');">xri</a></tt></tt><tt class="py-op">.</tt><tt id="link-22" class="py-name" targets="Function yadis.xri.rootAuthority()=yadis.xri-module.html#rootAuthority"><a title="yadis.xri.rootAuthority" class="py-name" href="#" onclick="return doclink('link-22', 'rootAuthority', 'link-22');">rootAuthority</a></tt></tt><tt class="py-op">(</tt><tt class="py-name">thexri</tt><tt class="py-op">)</tt><tt class="py-op">,</tt> </tt>
<tt class="py-lineno">111</tt>  <tt class="py-line">                                 <tt id="link-23" class="py-name"><a title="yadis.xri" class="py-name" href="#" onclick="return doclink('link-23', 'xri', 'link-1');">xri</a></tt></tt><tt class="py-op">.</tt><tt id="link-24" class="py-name" targets="Function yadis.xri.XRI()=yadis.xri-module.html#XRI"><a title="yadis.xri.XRI" class="py-name" href="#" onclick="return doclink('link-24', 'XRI', 'link-24');">XRI</a></tt></tt><tt class="py-op">(</tt><tt class="py-name">expected_root</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
</div></div><tt class="py-lineno">112</tt>  <tt class="py-line"> </tt>
<tt class="py-lineno">113</tt>  <tt class="py-line"> </tt>
<tt class="py-lineno">114</tt>  <tt class="py-line"> </tt>
<tt class="py-lineno">115</tt>  <tt class="py-line"><tt class="py-keyword">if</tt> <tt class="py-name">__name__</tt> <tt class="py-op">==</tt> <tt class="py-string">'__main__'</tt><tt class="py-op">:</tt> </tt>
<tt class="py-lineno">116</tt>  <tt class="py-line">    <tt class="py-keyword">import</tt> <tt class="py-name">unittest</tt> </tt>
<tt class="py-lineno">117</tt>  <tt class="py-line">    <tt class="py-name">unittest</tt><tt class="py-op">.</tt><tt class="py-name">main</tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
<tt class="py-lineno">118</tt>  <tt class="py-line"> </tt><script type="text/javascript">
<!--
expandto(location.href);
// -->
</script>
</pre>
<br />
<!-- ==================== NAVIGATION BAR ==================== -->
<table class="navbar" border="0" width="100%" cellpadding="0"
       bgcolor="#a0c0ff" cellspacing="0">
  <tr valign="middle">
  <!-- Home link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="yadis-module.html">Home</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Tree link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="module-tree.html">Trees</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Index link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="identifier-index.html">Indices</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Help link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="help.html">Help</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Project homepage -->
      <th class="navbar" align="right" width="100%">
        <table border="0" cellpadding="0" cellspacing="0">
          <tr><th class="navbar" align="center"
            ><a class="navbar" target="_top" href="http://www.openidenabled.com/yadis/">Python-Yadis</a></th>
          </tr></table></th>
  </tr>
</table>
<table border="0" cellpadding="0" cellspacing="0" width="100%%">
  <tr>
    <td align="left" class="footer">Generated by Epydoc
        3.0alpha3 on Fri Dec  8 13:17:19 2006</td>
    <td align="right" class="footer">
      <a href="http://epydoc.sourceforge.net">http://epydoc.sourceforge.net</a>
    </td>
  </tr>
</table>

<script type="text/javascript">
  <!--
  // Private objects are initially displayed (because if
  // javascript is turned off then we want them to be
  // visible); but by default, we want to hide them.  So hide
  // them unless we have a cookie that says to show them.
  checkCookie()
  // -->
</script>
  
</body>
</html>
